home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / TEMP / GNU / bison / BisonOptio < prev    next >
Text File  |  1995-06-28  |  5KB  |  153 lines

  1. Bison Options
  2. Previous: <Invocation=>Invocation> * Next: <Option Cross Key=>OptionCros> * Up: <Invocation=>Invocation>
  3.  
  4. #Wrap on
  5. {fH3}Bison Options{f}
  6.  
  7. Bison supports both traditional single-letter options and mnemonic long
  8. option names.  Long option names are indicated with {fEmphasis}--{f} instead of
  9. {fEmphasis}-{f}.  Abbreviations for option names are allowed as long as they
  10. are unique.  When a long option takes an argument, like
  11. {fEmphasis}--file-prefix{f}, connect the option name and the argument with
  12. {fEmphasis}={f}.
  13.  
  14. Here is a list of options that can be used with Bison, alphabetized by
  15. short option.  It is followed by a cross key alphabetized by long
  16. option.
  17.  
  18. #Indent +4
  19. #Indent
  20. {fEmphasis}-b {fStrong}file-prefix{f}{f}
  21. #Indent +4
  22. #Indent
  23. {fEmphasis}--file-prefix={fStrong}prefix{f}{f}
  24. #Indent +4
  25. Specify a prefix to use for all Bison output file names.  The names are
  26. chosen as if the input file were named {fCite}{fStrong}prefix{f}.c{f}.
  27.  
  28. #Indent
  29. {fEmphasis}-d{f}
  30. #Indent +4
  31. #Indent
  32. {fEmphasis}--defines{f}
  33. #Indent +4
  34. Write an extra output file containing macro definitions for the token
  35. type names defined in the grammar and the semantic value type
  36. {fCode}YYSTYPE{f}, as well as a few {fCode}extern{f} variable declarations.
  37.  
  38. If the parser output file is named {fCite}{fStrong}name{f}.c{f} then this file
  39. is named {fCite}{fStrong}name{f}.h{f}.
  40.  
  41. This output file is essential if you wish to put the definition of
  42. {fCode}yylex{f} in a separate source file, because {fCode}yylex{f} needs to
  43. be able to refer to token type codes and the variable
  44. {fCode}yylval{f}.  \*Note <Token Values=>TokenValue>: Semantic Values of Tokens.
  45.  
  46. #Indent
  47. {fEmphasis}-l{f}
  48. #Indent +4
  49. #Indent
  50. {fEmphasis}--no-lines{f}
  51. #Indent +4
  52. Don't put any {fCode}\#line{f} preprocessor commands in the parser file.
  53. Ordinarily Bison puts them in the parser file so that the C compiler
  54. and debuggers will associate errors with your source file, the
  55. grammar file.  This option causes them to associate errors with the
  56. parser file, treating it an independent source file in its own right.
  57.  
  58. #Indent
  59. {fEmphasis}-o {fStrong}outfile{f}{f}
  60. #Indent +4
  61. #Indent
  62. {fEmphasis}--output-file={fStrong}outfile{f}{f}
  63. #Indent +4
  64. Specify the name {fStrong}outfile{f} for the parser file.
  65.  
  66. The other output files' names are constructed from {fStrong}outfile{f}
  67. as described under the {fEmphasis}-v{f} and {fEmphasis}-d{f} switches.
  68.  
  69. #Indent
  70. {fEmphasis}-p {fStrong}prefix{f}{f}
  71. #Indent +4
  72. #Indent
  73. {fEmphasis}--name-prefix={fStrong}prefix{f}{f}
  74. #Indent +4
  75. Rename the external symbols used in the parser so that they start with
  76. {fStrong}prefix{f} instead of {fEmphasis}yy{f}.  The precise list of symbols renamed
  77. is {fCode}yyparse{f}, {fCode}yylex{f}, {fCode}yyerror{f}, {fCode}yynerrs{f},
  78. {fCode}yylval{f}, {fCode}yychar{f} and {fCode}yydebug{f}.
  79.  
  80. For example, if you use {fEmphasis}-p c{f}, the names become {fCode}cparse{f},
  81. {fCode}clex{f}, and so on.
  82.  
  83. \*Note <Multiple Parsers=>MultiplePa>: Multiple Parsers in the Same Program.
  84.  
  85. #Indent
  86. {fEmphasis}-t{f}
  87. #Indent +4
  88. #Indent
  89. {fEmphasis}--debug{f}
  90. #Indent +4
  91. Output a definition of the macro {fCode}YYDEBUG{f} into the parser file,
  92. so that the debugging facilities are compiled.  \*Note <Debugging=>Debugging>: Debugging Your Parser.
  93.  
  94. #Indent
  95. {fEmphasis}-v{f}
  96. #Indent +4
  97. #Indent
  98. {fEmphasis}--verbose{f}
  99. #Indent +4
  100. Write an extra output file containing verbose descriptions of the
  101. parser states and what is done for each type of look-ahead token in
  102. that state.
  103.  
  104. This file also describes all the conflicts, both those resolved by
  105. operator precedence and the unresolved ones.
  106.  
  107. The file's name is made by removing {fEmphasis}.tab.c{f} or {fEmphasis}.c{f} from
  108. the parser output file name, and adding {fEmphasis}.output{f} instead.
  109.  
  110. Therefore, if the input file is {fCite}foo.y{f}, then the parser file is
  111. called {fCite}foo.tab.c{f} by default.  As a consequence, the verbose
  112. output file is called {fCite}foo.output{f}.
  113.  
  114. #Indent
  115. {fEmphasis}-V{f}
  116. #Indent +4
  117. #Indent
  118. {fEmphasis}--version{f}
  119. #Indent +4
  120. Print the version number of Bison and exit.
  121.  
  122. #Indent
  123. {fEmphasis}-h{f}
  124. #Indent +4
  125. #Indent
  126. {fEmphasis}--help{f}
  127. #Indent +4
  128. Print a summary of the command-line options to Bison and exit.
  129.  
  130. #Indent
  131. {fEmphasis}-y{f}
  132. #Indent +4
  133. #Indent
  134. {fEmphasis}--yacc{f}
  135. #Indent +4
  136. #Indent
  137. {fEmphasis}--fixed-output-files{f}
  138. #Indent +4
  139. Equivalent to {fEmphasis}-o y.tab.c{f}; the parser output file is called
  140. {fCite}y.tab.c{f}, and the other outputs are called {fCite}y.output{f} and
  141. {fCite}y.tab.h{f}.  The purpose of this switch is to imitate Yacc's output
  142. file name conventions.  Thus, the following shell script can substitute
  143. for Yacc:
  144.  
  145. #Wrap off
  146. #fCode
  147. bison -y $\*
  148. #f
  149. #Wrap on
  150.  
  151. #Indent
  152.  
  153.